package com.carey.blog.repository;

import java.util.List;

import org.json.JSONObject;

import com.carey.blog.framework.latke.repository.Repository;
import com.carey.blog.framework.latke.repository.RepositoryException;

/**
 * Article-Comment repository.
 * 
 */
public interface ArticleCommentRepository extends Repository {

	/**
	 * Gets article-comment relations by the specified article id.
	 * 
	 * @param articleId
	 *            the specified article id
	 * @return for example
	 * 
	 *         <pre>
	 * [{
	 *         "oId": "",
	 *         "comment_oId": "",
	 *         "article_oId": articleId
	 * }, ....], returns an empty list if not found
	 * </pre>
	 * @throws RepositoryException
	 *             repository exception
	 */
	List<JSONObject> getByArticleId(final String articleId)
			throws RepositoryException;

	/**
	 * Gets an article-comment relation by the specified comment id.
	 * 
	 * @param commentId
	 *            the specified comment id
	 * @return for example
	 * 
	 *         <pre>
	 * [{
	 *         "oId": "",
	 *         "comment_oId": commentId,,
	 *         "article_oId": ""
	 * }, ....], returns {@code null} if not found
	 * </pre>
	 * @throws RepositoryException
	 *             repository exception
	 */
	JSONObject getByCommentId(final String commentId)
			throws RepositoryException;
}
